/*
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 1, or (at your option)
** any later version.

** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.

** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef __IA_SETTINGS_WINDOW_H__
#define __IA_SETTINGS_WINDOW_H__

#include <QDialog>
#include <QGridLayout>
#include <QGroupBox>
#include <QButtonGroup>
#include <QLabel>
#include <QLineEdit>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QRadioButton>
#include <QCheckBox>
#include <QComboBox>
#include <QPushButton>

class IASettingsWindow : public QDialog {
    Q_OBJECT
public:
    IASettingsWindow(QWidget * parent = 0, Qt::WindowFlags flags = 0);
    virtual ~IASettingsWindow() {};

    void setDirNames(const QStringList & dirNames) { dirsFld->addItems(dirNames); };

    void setServerName(const QString & name);
    void setServerPort(int p);
    void setUnits(int u);
    void setFormat(int f);
    void setFlashWarning(bool flag);
    void setMinCashWarning(double cash);
    void setAutoconnect(bool flag);
    void setSavePassword(bool flag);
    void setReconnect(bool flag);
    void setLinkHDD(bool flag);
    void setMinimize(bool flag);
    void setCashHint(bool flag);
    void setTraffHint(bool flag);
    void setHintDir(int dir);
    
    QString getServerName() const;
    int getServerPort() const;
    int getUnits() const;
    int getFormat() const;
    bool getFlashWarning() const;
    double getMinCashWarning() const;
    bool getAutoconnect() const;
    bool getSavePassword() const;
    bool getReconnect() const;
    bool getLinkHDD() const;
    bool getMinimize() const;
    bool getCashHint() const;
    bool getTraffHint() const;
    int getHintDir() const;

private:
    QGridLayout * mainLayout;
    QGroupBox * serverGroup;
    QGridLayout * sgPanel;
    QLabel * nameLbl;
    QLineEdit * nameFld;
    QLabel * portLbl;
    QLineEdit * portFld;
    QGroupBox * statGroup;
    QHBoxLayout * statPanel;
    QGroupBox * unitsGroup;
    QButtonGroup * unitsButtonGroup;
    QVBoxLayout * unitsPanel;
    QRadioButton * bBtn;
    QRadioButton * kbBtn;
    QRadioButton * mbBtn;
    QRadioButton * floatingBtn;
    QGroupBox * formatGroup;
    QButtonGroup * formatButtonGroup;
    QVBoxLayout * formatPanel;
    QRadioButton * upplusdownBtn;
    QRadioButton * downBtn;
    QRadioButton * updownBtn;
    QGroupBox * warningGroup;
    QHBoxLayout * warningPanel;
    QCheckBox * flashCB;
    QLineEdit * minCashFld;
    QGroupBox * otherGroup;
    QVBoxLayout * otherPanel;
    QCheckBox * autoCB;
    QCheckBox * savePWCB;
    QCheckBox * reconnectCB;
    QCheckBox * linkHDDCB;
    QCheckBox * minimizeCB;
    QGroupBox * hintGroup;
    QVBoxLayout * hintPanel;
    QCheckBox * cashHintCB;
    QCheckBox * traffHintCB;
    QLabel * dirLbl;
    QComboBox * dirsFld;
};

#endif
